package com.ruoyi.project.mydy.shortcomment.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.shortcomment.mapper.DlShortCommentMapper;
import com.ruoyi.project.mydy.shortcomment.domain.DlShortComment;
import com.ruoyi.project.mydy.shortcomment.service.IDlShortCommentService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 短评信息Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlShortCommentServiceImpl implements IDlShortCommentService 
{
    @Autowired
    private DlShortCommentMapper dlShortCommentMapper;

    /**
     * 查询短评信息
     * 
     * @param id 短评信息主键
     * @return 短评信息
     */
    @Override
    public DlShortComment selectDlShortCommentById(Long id)
    {
        return dlShortCommentMapper.selectDlShortCommentById(id);
    }

    /**
     * 查询短评信息列表
     * 
     * @param dlShortComment 短评信息
     * @return 短评信息
     */
    @Override
    public List<DlShortComment> selectDlShortCommentList(DlShortComment dlShortComment)
    {
        return dlShortCommentMapper.selectDlShortCommentList(dlShortComment);
    }

    /**
     * 新增短评信息
     * 
     * @param dlShortComment 短评信息
     * @return 结果
     */
    @Override
    public int insertDlShortComment(DlShortComment dlShortComment)
    {
        dlShortComment.setCreateTime(DateUtils.getNowDate());
        return dlShortCommentMapper.insertDlShortComment(dlShortComment);
    }

    /**
     * 修改短评信息
     * 
     * @param dlShortComment 短评信息
     * @return 结果
     */
    @Override
    public int updateDlShortComment(DlShortComment dlShortComment)
    {
        return dlShortCommentMapper.updateDlShortComment(dlShortComment);
    }

    /**
     * 批量删除短评信息
     * 
     * @param ids 需要删除的短评信息主键
     * @return 结果
     */
    @Override
    public int deleteDlShortCommentByIds(String ids)
    {
        return dlShortCommentMapper.deleteDlShortCommentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除短评信息信息
     * 
     * @param id 短评信息主键
     * @return 结果
     */
    @Override
    public int deleteDlShortCommentById(Long id)
    {
        return dlShortCommentMapper.deleteDlShortCommentById(id);
    }
}
